package org.SimpleSpringBoot.user;

import org.SimpleSpringBoot.annotation.Autowired;
import org.SimpleSpringBoot.web.RequestMapping;
import org.SimpleSpringBoot.web.RestController;

/**
 * 用户控制器
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 获取用户信息接口
     */
    @RequestMapping("/user")
    public String getUser() {
        return userService.getUser("张三");
    }

    /**
     * 获取用户列表接口
     */
    @RequestMapping("/users")
    public String getUsers() {
        return userService.getUserList();
    }

    /**
     * 处理用户接口
     */
    @RequestMapping("/process")
    public String processUser() {
        return userService.processUser("李四");
    }

    /**
     * 健康检查接口
     */
    @RequestMapping("/health")
    public String health() {
        return "应用状态: 正常运行";
    }
}

